package org.cs.publics.model;
// Generated 2018-12-28 17:39:08 by Hibernate Tools 5.2.3.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 商品图片管理表
 */

/**
 * GoodsImage generated by hbm2java
 */
@Entity
@Table(name = "goods_image", catalog = "good_fresh")
public class GoodsImage implements java.io.Serializable {

	private Integer goodsImageId;
	private GoodsInfo goodsInfo;
	private PickGoods pickGoods;
	private Date goodsImageCreateTime;
	private Date goodsImageUpdateTime;
	private String goodsImageUrl;
	private Integer goodsImageType;
	private Date createTime;
	private Date updateTime;
	private String goodsHoldOne;
	private String goodsHoldTwo;
	private Set<UserComment> userComments = new HashSet<UserComment>(0);

	public GoodsImage() {
	}

	public GoodsImage(GoodsInfo goodsInfo, PickGoods pickGoods, Date goodsImageCreateTime, Date goodsImageUpdateTime,
			String goodsImageUrl, Integer goodsImageType, Date createTime, Date updateTime, String goodsHoldOne,
			String goodsHoldTwo, Set<UserComment> userComments) {
		this.goodsInfo = goodsInfo;
		this.pickGoods = pickGoods;
		this.goodsImageCreateTime = goodsImageCreateTime;
		this.goodsImageUpdateTime = goodsImageUpdateTime;
		this.goodsImageUrl = goodsImageUrl;
		this.goodsImageType = goodsImageType;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.goodsHoldOne = goodsHoldOne;
		this.goodsHoldTwo = goodsHoldTwo;
		this.userComments = userComments;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "GOODS_IMAGE_ID", unique = true, nullable = false)
	public Integer getGoodsImageId() {
		return this.goodsImageId;
	}

	public void setGoodsImageId(Integer goodsImageId) {
		this.goodsImageId = goodsImageId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "GOODS_INFO_ID")
	public GoodsInfo getGoodsInfo() {
		return this.goodsInfo;
	}

	public void setGoodsInfo(GoodsInfo goodsInfo) {
		this.goodsInfo = goodsInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PICK_GOODS_ID")
	public PickGoods getPickGoods() {
		return this.pickGoods;
	}

	public void setPickGoods(PickGoods pickGoods) {
		this.pickGoods = pickGoods;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "GOODS_IMAGE_CREATE_TIME", length = 19)
	public Date getGoodsImageCreateTime() {
		return this.goodsImageCreateTime;
	}

	public void setGoodsImageCreateTime(Date goodsImageCreateTime) {
		this.goodsImageCreateTime = goodsImageCreateTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "GOODS_IMAGE_UPDATE_TIME", length = 19)
	public Date getGoodsImageUpdateTime() {
		return this.goodsImageUpdateTime;
	}

	public void setGoodsImageUpdateTime(Date goodsImageUpdateTime) {
		this.goodsImageUpdateTime = goodsImageUpdateTime;
	}

	@Column(name = "GOODS_IMAGE_URL", length = 50)
	public String getGoodsImageUrl() {
		return this.goodsImageUrl;
	}

	public void setGoodsImageUrl(String goodsImageUrl) {
		this.goodsImageUrl = goodsImageUrl;
	}

	@Column(name = "GOODS_IMAGE_TYPE")
	public Integer getGoodsImageType() {
		return this.goodsImageType;
	}

	public void setGoodsImageType(Integer goodsImageType) {
		this.goodsImageType = goodsImageType;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_TIME", length = 19)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UPDATE_TIME", length = 19)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "GOODS_HOLD_ONE", length = 25)
	public String getGoodsHoldOne() {
		return this.goodsHoldOne;
	}

	public void setGoodsHoldOne(String goodsHoldOne) {
		this.goodsHoldOne = goodsHoldOne;
	}

	@Column(name = "GOODS_HOLD_TWO", length = 25)
	public String getGoodsHoldTwo() {
		return this.goodsHoldTwo;
	}

	public void setGoodsHoldTwo(String goodsHoldTwo) {
		this.goodsHoldTwo = goodsHoldTwo;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "goodsImage")
	public Set<UserComment> getUserComments() {
		return this.userComments;
	}

	public void setUserComments(Set<UserComment> userComments) {
		this.userComments = userComments;
	}

}
